import requset from '@/api/request'

/**
 * 根据条件查询订单
 * @param {*} start
 * @param {*} limit
 * @param {*} data
 */
export function findOrdersByPage(start = 1, limit = 10, data) {
  return requset({
    url: `/lejuAdmin/order/findOrdersByPage/${start}/${limit}`,
    method: 'POST',
    data
  })
}
/**
 *  根据订单id查询订单详情
 * @param {`*`} orderId
 */
export function orderDetail(orderId) {
  return requset({
    url: `/lejuAdmin/order/orderDetail/${orderId}`,
    method: 'GET'
  })
}
/**
 * 确认发货
 * @param { } data  {orderId: '',deliverySn:'',deliveryCompany:''}
 */
// /lejuAdmin/order/sendDone
export function sendDone(data) {
  return requset({
    url: `/lejuAdmin/order/sendDone`,
    method: 'POST',
    data
  })
}

/**
 * 关闭订单
 * @param {*} orderId   订单id,非订单编号!!!
 */
export function finishOrder(orderId) {
  return requset({
    url: `/lejuAdmin/order/finishOrder/${orderId}`,
    method: 'POST'
  })
}
